package com.study.iostream;

import java.io.FileOutputStream;
import java.io.PrintStream;

/**
 * <p>添加类描述</p>
 *
 * @author chentao
 * @version v 0.1 2021/1/2 22:38
 */
public class PrintStream_ {
    public static void main(String[] args) throws Exception{
        FileOutputStream out = new FileOutputStream("F:\\test\\file\\test2.txt");
        PrintStream printer = new PrintStream(out);

        //创建一个对象
        Person p = new Person("李四", 24);

        //写入to.txt，
        printer.println(p);
        printer.print("Hello, it's me");

        //释放资源
        printer.close();
    }
}
